const _menus = [{"id":"1767457849746501632","parentId":"0","name":"表单1","alias":"bd1","icon":"","content":"{\"id\":\"1745710417801420800\",\"name\":\"表单控件\",\"key\":\"bdkj\"}","menuType":"page","type":6,"sn":1,"appId":"1767457121623715840","createTime":null,"createBy":null,"updateTime":null,"updateBy":null,"tenantId":"-1","authType":null,"authorization":[],"children":[],"isParent":"false","text":null,"pkVal":"1767457849746501632"}];

const _menusRouters = [{"path":"/bd1","name":"bd1","viewName":"WBdkjManager.vue"}];

export default {
    name: "menuData",
    getMenus() {
        return new Promise((resolve, reject) => {
            resolve(_menus);
        });
    },
    getMenuByAlias(alias, cb) {
        let r = null;
        _menus.forEach(function(x) {
            if (x.children) {
                if (!r || r.length == 0) {
                    r = x.children.filter(m => m.alias == alias);
                    if (r && r.length == 1) {
                        r[0].parent = x;
                    }
                }
            }
        });
        cb(r && r[0]);
    },
    getAppMenuRoutes(){
        return _menusRouters;
    }
}